package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.api.IScoreService;
import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.pojo.Score;
import com.lagou.rpc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author 梅松
 * @Date 2021/9/5 16:19
 */
@Controller
public class ScoreController {

    @Autowired
    private IScoreService scoreService;

    @GetMapping("/score/{id}")
    public String score(Model model,@PathVariable("id") int id){
        Score score = scoreService.getById(id);
        model.addAttribute("score",score);
        return "score";
    }
}
